<template>
    <el-dialog
      :title="title"
      :close-on-click-modal="false"
      :visible.sync="visible"
      :before-close="cancel"
      class="JNPF-dialog JNPF-dialog_center"
      lock-scroll
      width="65%"
    >
      <el-row :gutter="20" class="">
        <el-form
          ref="elForm"
          :model="dataForm"
          :rules="rules"
          label-width="120px"
        >
        <el-col :span="12">
          <el-form-item label="出库单号" prop="FBILLNO">
            <el-input v-model="dataForm.FBILLNO"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="出库日期" prop="FBILLCREDATE">
            <el-date-picker v-model="dataForm.FBILLCREDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>

        <el-col :span="12">
            <el-form-item label="处置企业">
              <el-select v-model="dataForm.FSUPPLIER" placeholder="请选择" >
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="存放仓库">
              <el-select v-model="dataForm.FSTOCK" placeholder="请选择" >
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="12">
          <el-form-item label="桶固定码" prop="FCATNO">
            <el-input v-model="dataForm.FCATNO"   />
          </el-form-item>
        </el-col>


        <el-col :span="12">
          <el-form-item label="危废桶名称" prop="FNAME">
            <el-input v-model="dataForm.FNAME"   />
          </el-form-item>
        </el-col>

        <el-col :span="12">
            <el-form-item label="危废名称">
              <el-select v-model="dataForm.FCATNAME" placeholder="请选择" >
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
          <el-form-item label="预约单号" prop="FCARDNO">
            <el-input v-model="dataForm.FCARDNO"   />
          </el-form-item>
        </el-col>

          <el-col :span="12">
          <el-form-item label="入库批号" prop="FSRCNO">
            <el-input v-model="dataForm.FSRCNO"   />
          </el-form-item>
        </el-col>

          <el-col :span="12">
          <el-form-item label="入库重量" prop="FWEIGHT" disabled>
            <el-input v-model="dataForm.FWEIGHT"   />
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="出库人员" prop="FUSER">
            <el-input v-model="dataForm.FUSER"   />
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="出库重量" prop="FOUTQTY">
            <el-input v-model="dataForm.FOUTQTY"   />
          </el-form-item>
        </el-col>


        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
        <el-button  v-if="insertorupdate" type="primary" v-loading="loading">确 定</el-button>
        <el-button v-else type="primary"  v-loading="loading">修 改</el-button>
      </span>
    </el-dialog>
  </template>
  <script>
  import jnpf from "@/utils/jnpf"
  export default {
    props: {
      parelist: {
        type: Array,
        default: []
      },
    },
    data() {
      return {
          checked1:true,
          checked2:true,
          checked3:true,
          checked4:true,
          checked5:true,
          title:"新增",
          dataForm:{
            FBILLNO:"20240905023",
            FBILLCREDATE:"2024-09-05 17:00:12",
            FSTOCK:"生物系仓库",
            FUSER:"韩信",
            FCATNO:"Z240801000965",
            FCATNAME:"危废化学品盛漏油桶",
            FNAME:"生物实验废物",
            FWEIGHT:"53.7",
            FSUPPLIER:"江苏金聚鑫再生资源回收有限公司",
            FOUTQTY:"45.0",
            FSRCNO:"20240901001"
          },
          rules: {
            FCATNO: [
                  { required: true, message: '请输入危废类别编号', trigger: 'blur' },
              ],
              FCATNAME: [
                  { required: true, message: '请输入行业来源', trigger: 'blur' },
              ],
          },
        fvisiblelist:[
          {id:"1",fullName:"是"},
          {id:"2",fullName:"否"},
        ],

        //所属教学楼选择数据
        options1: [{
          value: '20E01',
          label: '医疗废物'
        }, {
          value: '20E02',
          label: '医药废物'
        }, {
          value: '20N03',
          label: '废有机溶剂与含有机溶剂废物'
        }, {
          value: '20E04',
          label: '多氯（溴）联苯类废物'
        }],

        options2: [{
          value: '1',
          label: '卫生'
        }, {
          value: '2',
          label: '化学药品原药制造'
        }, {
          value: '3',
          label: '生物、生化制品的制造'
        }],

        options3: [{
          value: '1',
          label: '危险废物'
        }, {
          value: '2',
          label: '一般固废'
        }],

        loading:false,
        visible:false,
        insertorupdate:true
      };
    },
    created() {
    },
    mounted() {},
    methods: {
      //
      init(id){
        this.dataForm.FCATNO= id || ''
          if(this.dataForm.FCATNO)
          {
              this.title="修改"
             this.insertorupdate=false;
          }
          else
          {
            this.insertorupdate=true;
              this.title="新增";
          }
          this.visible=true;
      },
      //
      cancel(){
          this.$refs.elForm.resetFields();
          this.visible=false;
      },
    },
  };
  </script>
  
  
  
  
  